﻿<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<div style="clear:both;"></div>
<div class="com_geotrails_row">
	<ul>
	<?php $i = 0; ?>
	<?php foreach ($this->trails as $trail) { ?>
		<?php if ($i >= $this->paginate && $this->params->get('show_paginate')) { ?>
		<?php break; ?>
		<?php } ?>
		<?php if (!strlen($trail->picture)) { ?>
		<?php $image_file = 'components/com_geotrails/assets/images/no_image.jpg'; ?>
		<?php } else { ?>
		<?php $image_file = GeoTrailsModelGeoTrails::imageResize($trail->picture, 240, 120, 100); ?>
		<?php } ?>
		<li>
			<a href="<?php echo JRoute::_(GeotrailsHelperRoute::getGeotrailsRoute($trail["id"], $trail->name, $this->Itemid), false); ?>">
				<img src="<?php echo $image_file; ?>" class="image" alt="<?php echo $trail->name; ?>" />
			</a>
			<p>
				<a href="<?php echo JRoute::_(GeotrailsHelperRoute::getGeotrailsRoute($trail["id"], $trail->name, $this->Itemid), false); ?>">
					<?php echo $trail->name; ?>
				</a>
			</p>
			<p>
				<label><?php echo JText::_('COM_GEOTRAILS_GEOTRAILS_VIEW_CB_ACTIVITE');?></label><?php echo ': '.JText::_('COM_GEOTRAILS_GEOTRAILS_VIEW_CB_ACTIVITE_'.$trail->activity_id); ?><br />
				<label><?php echo JText::_('COM_GEOTRAILS_DIFFICULTY');?></label><?php echo ': '.JText::_('COM_GEOTRAILS_DIFFICULTY_'.$trail->difficulty_id); ?><br />
				<label><?php echo JText::_('COM_GEOTRAILS_DURATION');?></label><?php echo ': '.$trail->duration.' ('.$trail->duration_m.' '.JText::_('COM_GEOTRAILS_DURATION_MIN').')'; ?>				
			</p>
			<p>
				<a href="<?php echo JRoute::_(GeotrailsHelperRoute::getGeotrailsRoute($trail["id"], $trail->name, $this->Itemid), false); ?>" class="link">
					<?php echo JText::_('COM_GEOTRAILS_VIEW_GEOTRAILS_MORE'); ?>
				</a>
			</p>
		</li>
		<?php $i++; ?>
	<?php } ?>
	</ul>
</div>